import InterviewConfig from '@/pages/Recruitment/External/RecruitEmail/config/interviewConfig';

// 'InterviewConfirmArrange'
export default {
    namespace: 'interviewEmail',
    state: {
        currStep: 1, // 面试邀请 面试结果通知  录用通知   入职
        currInterviewStep: 'InterviewConfirmArrange',
        currInterviewResultStep: 1,
        currInterviewOfferStep: 1,
        currInterviewJoinStep: 1,
        InterviewView: null,
        InterviewResultView: null,
        InterviewOfferView: null,
        InterviewJoinStepView: null
    },
    reducers: {
        initStep(state, { payload }) {
            return {
                ...state,
                ...payload
            };
        },
        setCurrStep(state, { payload }) {
            return {
                ...state,
                currStep: payload
            };
        },
        setCurrInterviewStep(state, { payload }) {
            return {
                ...state,
                currInterviewStep: payload,
                InterviewView: InterviewConfig[payload]
            };
        },
        setCurrInterviewResultStep(state, { payload }) {
            return {
                ...state,
                currInterviewResultStep: payload,
                InterviewResultView: InterviewConfig[payload]
            };
        },
        setCurrInterviewOfferStep(state, { payload }) {
            return {
                ...state,
                currInterviewOfferStep: payload,
                InterviewOfferView: InterviewConfig[payload]
            };
        },
        setCurrInterviewJoinStep(state, { payload }) {
            return {
                ...state,
                currInterviewJoinStep: payload,
                InterviewJoinStepView: InterviewConfig[payload]
            };
        }
    }
};
